#include "spu.h"

void print_id(char *str)
{
	pid_t pid;
	pthread_t tid;
	
	pid = getpid();
	tid = pthread_self();
	printf("%s pid = %u, tid = 0x%x\n", str, pid, tid);
}

void *thread_fun(void *arg)
{
	print_id(arg);
	//return (void*)0;
}

int main()
{	
	int err;
	pthread_t thread_id;

	err = pthread_create(&thread_id, NULL, thread_fun, "new thread");
	if(err != 0)
		printf("create fail, err = %d\n",err);
	else
		printf("create success!\n");

	sleep(1);
	print_id("main_id: ");

	return 0;
}

